package cardmanager.enums;

public enum CardType { Continuous(0x20000),Counter(0x100000),Dual(0x800),Effect(0x20),Equip(0x40000),
Field(0x80000),Flip(0x200000),Fusion(0x40),Monster(1),Normal(0x10),QuickPlay(0x10000),Ritual(0x80),
Spell(2),Spirit(0x200),Synchro(0x2000),Token(0x4000),Toon(0x400000),Trap(4),TrapMonster(0x100),
Tuner(0x1000),Union(0x400),Xyz(0x800000);
private int value;

private CardType(int value) 
{
        this.value = value;
}
public int getValue()
{
	return value;
}
public static CardType fromInt(int code) {
	
	switch(code) 
	{
		case 0x20000:
			return Continuous;
		case 0x100000:
			return Counter;
		case 0x800:
			return Dual;
		case 0x20:
			return Effect;
		case 0x40000:
			return Equip;
		case 0x80000:
			return Field;
		case 0x200000:
			return Flip;
		case 0x40:
			return Fusion;
		case 1:
			return Monster;
		case 0x10:
			return Normal;
		case 0x10000:
			return QuickPlay;
		case 0x80:
			return Ritual;
		case 2:
			return Spell;
		case 0x200:
			return Spirit;
		case 0x2000:
			return Synchro;
		case 0x4000:
			return Token;
		case 0x400000:
			return Toon;
		case 4:
			return Trap;
		case 0x100:
			return TrapMonster;
		case 0x1000:
			return Tuner;
		case 0x400:
			return Union;
		case 0x800000:
			return Xyz;
		}
	return null;
}

}
